
; 1st Person Gunner Mode with a hunter. Fly a hunter and shoot the weapons
; with 1st Person Gunner view. 

; This code is for testing only. It creates a hunter south of the southest
; building on the first island.

; Controls:
; sprint key               - fly forward in direction of hunter
; sprint key + jump key    - fly forward in direction of hunter and hard up  
; sprint key + crouch key  - fly forward in direction of hunter and hard down
; camera key               - turn the hunter to where you're looking.

; jump key only            - go higher slowly without going forward or backwards
; crouch key only          - go lower slowly without going forward or backwards 


004F: create_thread Createhunter  

...

:Createhunter
0001: wait 500 ms 
00D6: if 0 
0256:   player $PLAYER_CHAR defined 
004D: jump_if_false Createhunter 

0247: request_model #hunter 
0247: request_model #minigun 

:chloadhunter
0001: wait 0 ms 
00D6: if 1 
0248:   model #hunter available 
0248:   model #minigun available 
004D: jump_if_false chloadhunter 

00A5: $tmphunter = create_car #hunter at -136.0 -1572.0 12.0 

:chchkhunter
0001: wait 0 ms 
00D6: if 0 
00E3:   player $PLAYER_CHAR 0 near_point -136.0 -1572.0 radius 4.0 4.0 
004D: jump_if_false chchkhunter 

0464: put_actor $PLAYER_ACTOR into_turret_on_car $tmphunter at_car_offset 0.0 5.5 -1.8 unknown 1 angle 180.0 with_weapon 33 

0249: release_model #hunter 
0249: release_model #minigun 

04A2: heli $tmphunter fly_to -136.0 -1572.0 30.0 speed 7   ;; start engines and take off

:loophunter
0001: wait 0 ms 
00D6: if 0 
00E1:   key_pressed 0 16   ;; sprint key (fly forward in direction of hunter)
004D: jump_if_false loophunter7 
0407: create_coordinate 1@ 2@ 3@ from_car $tmphunter offset 0.0 30.0 0.0 
00AA: store_car $tmphunter position_to 6@ 7@ 8@ 
00D6: if 0 
00E1:   key_pressed 0 14   ;; jump key (go higher)
004D: jump_if_false loophunter6_2 
000B: 8@ += 10.0  ;; floating-point values  - fly forward in direction of hunter and hard up

:loophunter6_2
00D6: if 0 
00E1:   key_pressed 0 18   ;; crouch key (go lower)
004D: jump_if_false loophunter6_3 
000F: 8@ -= 10.0  ;; floating-point values  - fly forward in direction of hunter and hard down

:loophunter6_3
04A2: heli $tmphunter fly_to 1@ 2@ 8@ speed 50 

:loophunter7
00D6: if 0 
00E1:   key_pressed 0 13   ;; camera key (turn hunter where player is looking)
004D: jump_if_false loophunter8 
0170: 5@ = player $PLAYER_CHAR z_angle 
04D0: unknown_heli $tmphunter turn_to_angle 5@ 

:loophunter8
00D6: if 1 
00E1:   key_pressed 0 14 
80E1:   NOT   key_pressed 0 16 
004D: jump_if_false loophunter9 
00AA: store_car $tmphunter position_to 6@ 7@ 8@ 
000B: 8@ += 5.0  ;; floating-point values  - go higher slowly without going forward or backwards
04A2: heli $tmphunter fly_to 6@ 7@ 8@ speed 50 

:loophunter9
00D6: if 1 
00E1:   key_pressed 0 18 
80E1:   NOT   key_pressed 0 16 
004D: jump_if_false loophunter 
00AA: store_car $tmphunter position_to 6@ 7@ 8@ 
000F: 8@ -= 5.0  ;; floating-point values  - go lower slowly without going forward or backwards
04A2: heli $tmphunter fly_to 6@ 7@ 8@ speed 50 
0002: jump loophunter 
